Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing /
Chapter 2 - Core Printing Features / Core Printing Features Reference
Functions / Printing With QuickDraw GX


GXPrintPage

You can use the GXPrintPage function to print a page in a document if your application stores each page as a single picture shape.

void GXPrintPage (gxJob aJob, long pageNumber, gxFormat aFormat,
                  gxShape aPage);
aJob
A reference to the job object whose page you want to print.
pageNumber

The page number for the page.
aFormat
A reference to the format object for the page.
aPage
A reference to the picture shape that specifies the output for the page.
DESCRIPTION
The GXPrintPage function prints a page of a document. In the aPage parameter, you specify the picture shape for each page. In the pageNumber parameter, you set the page to print. QuickDraw GX compares the specified page number with the page range chosen by the user and spools the page if it is within the page range. If it is not within the range, QuickDraw GX ignores the data.

In the aFormat parameter, you specify the format object for the page. You need to provide your own mechanism for associating individual document pages with format objects.

You should loop through each page of a document, calling the GXPrintPage function for each page's picture shape. You should check for errors after you print each page and exit the loop if necessary.

If your application does not store each page as a single picture shape, you should use the GXStartPage, GXDrawShape, and GXFinishPage functions to print the page.

RESULT CODES
gxPrUserAbortErrThe user has canceled printing.
gxSegmentLoadFailedErrA required code segment could not be found, or there was not enough memory to load it.
SEE ALSO
Listing 2-5 on page 2-21 shows how to use the GXPrintPage function to print each page of a document.

Picture shapes are discussed in Inside Macintosh: GX Graphics.

The GXStartPage function is described on page 2-66. The GXFinishPage function is described on page 2-67. The GXDrawShape function is described in the shape objects chapter of Inside Macintosh: GX Objects.

In addition to the result codes listed above, you may also receive errors that can occur while flattening graphics objects during spooling. For more information about the spooling phase of printing, see the chapter "Introduction to Printing With QuickDraw GX" in this book. Flattening graphics objects is described in the shape objects chapter of Inside Macintosh: GX Objects.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help